import React, {Component} from 'react';
import classnames from 'classnames'
import {DEFAULT, TIME} from "@/NewComment/constants";

class CommentHeader extends Component {
  render() {
    const {changeActive, active} = this.props
    return (
      <h3 className="comm-head">
        热门评论<sub>({this.props.len})</sub>
        <span
          className={classnames({active: active === DEFAULT})}
          onClick={changeActive(DEFAULT)}
        >
        默认
      </span>
        <span
          className={classnames({active: active === TIME})}
          onClick={changeActive(TIME)}
        >
        时间
      </span>
      </h3>
    );
  }
}

export default CommentHeader;
